
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta content="yes" name="apple-mobile-web-app-capable" />
        <meta content="black" name="apple-mobile-web-app-status-bar-style" />
        <meta content="telephone=no" name="format-detection" />
        <meta name="HandheldFriendly" content="true" />
        <title>转转麻将 房间信息</title>
        <style>
            body,div,input,textarea,p,th,td{padding:0;margin:0;border:none;line-height:1;font-family:"宋体";}
            a{text-decoration:none;}
            img{display:block;width:100%;}
            html,body{width:100%;height:100%;overflow:hidden;}
            .pr{position:relative;}
            .pa{position:absolute;}
            .wrapper,.bar>span{background-size:contain;}
            .wrapper{height:100%;margin:0 auto;background-image:url('image/bg.png');background-repeat:no-repeat;-webkit-background-size:100% 100%;-moz-background-size:100% 100%;background-size:100% 100%;}
            .wrapper .center{text-align:center;height:100%;width:100%;top:0;left:0;}
            #tipdiv{width: 100%; height: 100%; background-color:#000000; background: url('image/trans-bgs.png') repeat; position:absolute;top:0;z-index:10;display:none;}
            #tipdiv-box{width: 100%;height: 100%;background: url('image/tips2.png') no-repeat;background-size: 100%; z-index:10;}
            #downdiv {width: 100%;height: 100%;position: absolute;display:none;z-index:5;}
            #downdiv a{width:50%;height:auto;overflow:hidden;display:inline-block;position:relative;top:86%;}
            #downdiv a img {max-height:100px;}
            #msg {color: #FFF;width: 100%;top:0;left:0;text-align: center;font-weight: bold;position: absolute;z-index:1;}
            #frm {position: fixed;z-index:-1;height:1px;width:1px;display:block;}
            #description,#description2,#description3 {position:relative;top:64.5%;text-align:center;color:#69D2FF; font-size:18pt; line-height:20pt; font-weight:600;z-index:30; display:none;}
            @media (max-height: 740px) {#description,#description2 {top:62%;font-size:18pt; line-height:20pt;}}
            @media (max-height: 500px) {#description,#description2 {font-size:11pt; line-height:15pt; font-weight:500;}}
            #description,#description2 a {color:red;}
            #description2 {font-size:14pt; top:38%; line-height:25pt;}
            #description3 {font-size:13pt; top:23%; font-family: "微软雅黑"; color: #000;}
        </style>
        <script>
            function copy_code(){
                var copyText = document.getElementById('description').innerHTML;
                if (copyText.length > 0 && window.clipboardData) {
                    window.clipboardData.setData('Text', copyText);
                    alert('已复制到剪贴板！');
                } else {}
            }
        </script>
    </head>
    <body>
        <div class="wrapper pr">
            <div class="center pa">
                <div id="downdiv"><a id="download" href="http://jfys.bzw.cn/apk/android/MyLuaGame-release.apk"><img id="downimg" src="image/btn.png"></a></div>
                <div id="description" onclick="copy_code();">小窍门：<br>在浏览器中打开，可直接进入房间！</div>
                                    <div id="description2">
                        【房号】<br>863119<br><br>
                        【襄阳玩法 | 全频道、不买马】<br> 8局、卡五星2倍、不漂、房主支付、8倍封顶<br>
                    </div>
                                <div id="description3">如出现无法打开网页，请点击“好”后继续下载</div>
                <div id="tipdiv">
                    <div id="tipdiv-box"></div>
                </div>
                <div id="msg"></div>
                <script>
                    //window.history.forward(0);
                    (function(){
                        var config = {
                            ad: '',
                            scheme_IOS: 'com.boyaa.MahjongKawuxing://?mid=1264245&fid=863119&timestamp=1516073598',
                            scheme_Adroid: 'jfapk://com.zyl.tzgame5?mid=1264245&fid=863119&timestamp=1516073598',
                            download_IOS: 'http://itunes.apple.com/cn/app/id1070437555',
                            download_Adroid: 'http://jfys.bzw.cn/apk/android/MyLuaGame-release.apk',
                            timeout1: 300,
                            timeout2: 600,
                            timeout_d: 1000
                        };
                        var ua = navigator.userAgent.toLowerCase();
                        var isios = false;
                        var isweixin = false;
                        var isqq = false;
                        if (/iphone|ipad|ipod/.test(ua)) {
                            isios = true;
                        }
                        if (/micromessenger/.test(ua)) {
                            isweixin = true;
                        }
                        if (/qq\//.test(ua)) {
                            isqq = true;
                        }
                        var t,t1;
                        var hasApp = true;
                        var endTime = 0;
                        var ifr = document.createElement('iframe');
                        function openclient() {
                            setTimeout(function () {
                                clears();
                                if (hasApp) { } else {
                                    download();
                                }
                            }, config.timeout_d);
                            var startTime = +Date.now();
                            ifr.setAttribute('id', 'frm');
                            ifr.setAttribute('src', (isios === true) ? config.scheme_IOS : config.scheme_Adroid);
                            if (isios === true) {
                                config.timeout1 = 1;
                            } else {
                                document.body.appendChild(ifr); //第一种方式
                            }
                            t = setTimeout(function () {
                                document.getElementById('msg').innerHTML = '检测并打开游戏';
                                if (isios === true) {
                                    window.location.href = config.scheme_IOS; //IOS第二种方式
                                }
                                t1 = setTimeout(function () {
                                    endTime = +Date.now();
                                    if (!startTime || endTime - startTime < config.timeout1 + config.timeout2 + 200) {
                                        hasApp = false;
                                    } else {
                                        download();
                                    }
                                    document.getElementById('description3').style.display = 'none';
                                }, config.timeout2);
                            }, config.timeout1);
                            window.onblur = function () {
                                if (endTime > 0) clears();
                            };
                        }
                        function clears() {
                            clearTimeout(t);
                            clearTimeout(t1);
                            if (document.body.getElementsByTagName('iframe').length > 0)
                                document.body.removeChild(ifr);
                            document.getElementById('msg').innerHTML = config.ad;
                        }
                        function download() {
                            document.getElementById('downdiv').style.display = 'block';
                            if (isios === true) {
                                document.getElementById('download').href = config.download_IOS;
                                document.getElementById('description3').style.display = 'block';
                            }
                            if (isweixin === true || isqq === true) {
                                document.getElementById('tipdiv').style.display = 'block';
                                document.getElementById('downimg').src = 'image/down2in.png';
                                document.getElementById('description2').style.display = 'block';
                            } else if (!hasApp) {
                                document.getElementById('description').style.display = 'block';
                            }
                        }
                        download();
                        openclient();
                    })();
                </script>
            </div>
        </div>
    </body>
</html>
